//
//  JZDetViewController.m
//  YaDiuDiu
//
//  Created by 欧洪飞 on 2017/10/25.
//  Copyright © 2017年 jy. All rights reserved.
//

#import "JZDetViewController.h"

#import "JZAddView.h"
@interface JZDetViewController ()

@end

@implementation JZDetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = COLOR_RGB(242, 242, 242, 1);
    [self showNav:@"商品详情"];
    [self loadUI];
    
}

- (void)loadUI{
    UIScrollView *sclView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 64, ScreenWidth, ScreenHeight-64)];
    sclView.contentSize = CGSizeMake(ScreenWidth, 600);
    sclView.backgroundColor =  COLOR_RGB(242, 242, 242, 1);
    [self.view addSubview:sclView];
    NSString *classname = [_dic objectForKey:@"classname"];
    if ([classname isEqualToString:@"家政"]) {
        JZAddView *addView = [[[NSBundle mainBundle] loadNibNamed:@"JZAddView" owner:nil options:nil] lastObject];
        addView.frame = CGRectMake(0, 0, ScreenWidth, 290);
        [sclView addSubview:addView];
        
        addView.textIntro.layer.cornerRadius = 5.0;
        addView.textIntro.layer.borderWidth = 1.0;
        addView.textIntro.layer.borderColor = COLOR_RGB(242, 242, 242, 1).CGColor;
        
        addView.textIntro.userInteractionEnabled = NO;
        addView.textPrice.userInteractionEnabled = NO;
        
        addView.labType.text = classname;
        addView.textIntro.text = [_dic objectForKey:@"synopsis"];
        addView.textPrice.text = [_dic objectForKey:@"price"];
        addView.textArea.text = [_dic objectForKey:@"proportion"];
        addView.labSelDic.text = [_dic objectForKey:@"directionidname"];
        
    }else{
        JZAddView *addView = [[[NSBundle mainBundle] loadNibNamed:@"JZAddView" owner:nil options:nil] lastObject];
        addView.frame = CGRectMake(0, 0, ScreenWidth, 183);
        [sclView addSubview:addView];
        
        addView.textIntro.userInteractionEnabled = NO;
        addView.textPrice.userInteractionEnabled = NO;
        addView.labArea.hidden = YES;
        addView.labDic.hidden = YES;
        addView.images.hidden = YES;
        addView.labLine.hidden = YES;
        addView.textArea.hidden = YES;
        addView.labSelDic.hidden = YES;
        
        addView.labType.text = classname;
        addView.textIntro.text = [_dic objectForKey:@"synopsis"];
        addView.textPrice.text = [_dic objectForKey:@"price"];
        addView.textArea.text = [_dic objectForKey:@"proportion"];
        addView.labSelDic.text = [_dic objectForKey:@"directionidname"];
        addView.labSelDic.textColor = [UIColor darkGrayColor];
    }
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
